package test.com.db.wait.interrupt;

public class Experiment {
    public static void main(String... arg) throws InterruptedException {
        Block block = new Block();
        Thread thread = new Thread() {
            @Override
            public void run() {
                synchronized (block) {
                    try {
                        for (int i = 0; i < 100; ++i);
                        System.err.println("counted");
                        block.wait();
                    } catch (InterruptedException e) {
                        System.err.println("interrupted");
                    }
                }
            }
        };
        thread.start();
        thread.interrupt();
        System.err.println("---------");
        //synchronized (block) {
        //    block.notifyAll();
        //}
    }

    private static class Block {
    }
}
